﻿<?xml version="1.0" encoding="utf-8"?><!-- DWXMLSource="../../SAW WebSite/CotizacionesXML/1234568/1234568.xml" -->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:doc='http://wlm.com.mx/SAI/doc'>
  <xsl:output method="html" encoding="utf-8" doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>
  <xsl:param name="tipoImpresion"></xsl:param>
  <xsl:decimal-format name="dollar"
decimal-separator="." grouping-separator=","/>
  <xsl:template match="//doc:Documento">
  <xsl:variable name="urlTrans">F:\NET\SAW\SAW POS\xsl\</xsl:variable>
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>Documento Cotizacion</title>
    </head>
    <link href="{$urlTrans}960_24_col.css" rel="stylesheet" type="text/css" />
    <link href="{$urlTrans}xslTrans.css" rel="stylesheet" type="text/css" />
    <body>
    <div>
    <div id="ContenedorPrincipal" class="container_24">
      <div class="grid_24">
      <h1>VENTA No.<xsl:value-of select="@NoDocumento"/> - <xsl:call-template name="FormatDate">
                        <xsl:with-param name="DateTime" select="@FechaCreacion"/>
                      </xsl:call-template></h1>
      </div>
      <div class="grid_24">
      	<h2>Cliente</h2>
        <h3>No. <xsl:value-of select="@NoCliente"/> - <xsl:value-of select="@NombreComercial"/></h3>
        <xsl:value-of select="@RFC"/><br />

<xsl:value-of select="@NombreCliente"/><br />
<xsl:apply-templates select="//doc:DireccionFacturacion"/>  
      </div>

      <div>

      <div><h3>CONCEPTOS</h3></div>
        <table id="items">
          <tbody>
            <tr>
              <th>Clave</th>
              
              <th>Descripcion</th>
              <th>Cantidad</th>

                <th>Precio</th>
                <th>Importe</th>

            </tr>
            <xsl:apply-templates  select="//doc:Concepto">
              <xsl:with-param name="tipoImp" select="$tipoImpresion"/>
            </xsl:apply-templates>
            <xsl:for-each select="Concepto">
            </xsl:for-each>



              <tr>
                <td colspan="2" rowspan="4" class="blank" valign="top" style="padding:20px;">
<br />

                </td>
                <td colspan="2" class="total-line">Subtotal</td>
                <td class="total-value moneda">
                  <div id="subtotal">
                    $<xsl:value-of select="format-number(@SubTotal, '#,##0.00','dollar')"/>
                  </div>
                </td>
              </tr>
              <tr>
                <td colspan="2" class="total-line">Descuento <xsl:value-of select="format-number(@DescuentoPorcentaje, '#,##0.00','dollar')"/> %
              </td>
                <td class="total-value moneda">
                  <div id="total">
                    $<xsl:value-of select="format-number(@Descuento, '#,##0.00','dollar')"/>
                  </div>
                </td>
              </tr>
              <tr>
                <td colspan="2" class="total-line">I.V.A.</td>
                <td class="total-value moneda">
                  $<xsl:value-of select="format-number(@IVA, '#,##0.00','dollar')"/>
                </td>
              </tr>
              <tr>
                <td colspan="2" class="total-line balance">TOTAL</td>
                <td class="total-value balance moneda">
                  <div class="due">
                    $<xsl:value-of select="format-number(@Total, '#,##0.00','dollar')"/>
                  </div>
                </td>
              </tr>
              
        
  
             
     
          </tbody>
        </table>
      </div>
    </div>
    </div>
    </body>
    </html>
  </xsl:template>
  <xsl:template match="//doc:Concepto">
    <xsl:param name="tipoImp"></xsl:param>
    <tr class="item-row">
      <td >
        <xsl:value-of select="@noIdentificacion"/>
      </td>
      
      <td class="description">
        <xsl:value-of select="@descripcion"/>
      </td>
      <td class="moneda">
        <xsl:value-of select="@cantidad"/>
        
      </td>

        <td class="moneda">
          $<xsl:value-of select="format-number(@valorUnitario, '#,##0.00','dollar')"/>
        </td>
        <td class="moneda">
          <span class="price">
            $<xsl:value-of select="format-number(@importe, '#,##0.00','dollar')"/>
          </span>
        </td>

    </tr>
    
  </xsl:template>
 
  <xsl:template match="//doc:DireccionFacturacion">
<xsl:value-of select="@Calle"/><xsl:value-of select="@NumeroExterior"/> &#160;<xsl:value-of select="@NumeroInterior"/><br />

              <xsl:value-of select="@Colonia"/>, <xsl:value-of select="@Ciudad"/><br />
<xsl:value-of select="@Municipio"/>, <xsl:value-of select="@Estado"/>. <xsl:value-of select="@CP"/>
  </xsl:template>
  <xsl:template match="//doc:DireccionEnvio">
    <div id="address"><div id="addressheader">Direccion de Envio:</div>
    <table id="meta-1">
            <tbody>
              <tr>
                <td class="meta-head">Calle</td>
                <td><xsl:value-of select="@Calle"/><xsl:value-of select="@NumeroExterior"/>-<xsl:value-of select="@NumeroInterior"/></td>
              </tr>
              <tr>
                <td class="meta-head">Colonia</td>
                <td><xsl:value-of select="@Colonia"/></td>
              </tr>
              <tr>
                <td class="meta-head">Ciudad</td>
                <td><xsl:value-of select="@Ciudad"/></td>
              </tr>
              <tr>
                <td class="meta-head">Municipio</td>
                <td><xsl:value-of select="@Municipio"/></td>
              </tr>
              <tr>
                <td class="meta-head">Estado</td>
                <td><xsl:value-of select="@Estado"/></td>
              </tr>
              <tr>
                <td class="meta-head">C.P.</td>
                <td><xsl:value-of select="@CP"/></td>
              </tr>
              </tbody>
              </table>
              </div>
              
  </xsl:template>
  <xsl:template name="FormatDate">
    <xsl:param name="DateTime" />
    <xsl:variable name="year" select="substring($DateTime,1,4)" />
    <xsl:variable name="month-temp" select="substring-after($DateTime,'-')" />
    <xsl:variable name="month" select="substring-before($month-temp,'-')" />
    <xsl:variable name="day-temp" select="substring-after($month-temp,'-')" />
    <xsl:variable name="day" select="substring($day-temp,1,2)" />
    <xsl:variable name="time" select="substring-after($DateTime,'T')" />
    <xsl:variable name="hh" select="substring($time,1,2)" />
    <xsl:variable name="mm" select="substring($time,4,2)" />
    <xsl:variable name="ss" select="substring($time,7,2)" />
    
    <!-- Long DATE FORMAT -->
    
    <xsl:value-of select="$day"/><xsl:value-of select="' de '"/><!--January -->
    <!--January 12 -->
    <xsl:choose>
      <xsl:when test="$month = '1' or $month= '01'">
        Enero
      </xsl:when>
      <xsl:when test="$month = '2' or $month= '02'">
        Febrero
      </xsl:when>
      <xsl:when test="$month= '3' or $month= '03'">
        Marzo
      </xsl:when>
      <xsl:when test="$month= '4' or $month= '04'">
        Abril
      </xsl:when>
      <xsl:when test="$month= '5' or $month= '05'">
        Mayo
      </xsl:when>
      <xsl:when test="$month= '6' or $month= '06'">
        Junio
      </xsl:when>
      <xsl:when test="$month= '7' or $month= '07'">
        Julio
      </xsl:when>
      <xsl:when test="$month= '8' or $month= '08'">
        Augosto
      </xsl:when>
      <xsl:when test="$month= '9' or $month= '09'">
        Septiembre
      </xsl:when>
      <xsl:when test="$month= '10'">
        Octubre
      </xsl:when>
      <xsl:when test="$month= '11'">
        Noviembre
      </xsl:when>
      <xsl:when test="$month= '12'">
        Diciembre
      </xsl:when>
    </xsl:choose>
    <xsl:value-of select="' de'"/><!--January 12,-->
    <xsl:value-of select="' '"/><!--January 12, -->
    <xsl:value-of select="$year"/><!--January 12, 2001-->
    <!--
    <xsl:value-of select="' a las '"/><xsl:value-of select="$hh"/><xsl:value-of select="':'"/><xsl:value-of select="$mm"/><xsl:value-of select="':'"/><xsl:value-of select="$ss"/><xsl:value-of select="' (GMT) '"/>-->
    <!-- END: Long DATE FORMAT -->
    
  </xsl:template>
</xsl:stylesheet>

